﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceProcess;
using System.Text;

namespace InsertMailService
{
    static class Program
    {
        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                ServiceBase[] ServicesToRun;
                ServicesToRun = new ServiceBase[]
                                    {
                                        new InsertMailService()
                                    };
                ServiceBase.Run(ServicesToRun);
            }
            else
            {
                InsertMailService sendMailService = new InsertMailService();
                sendMailService.Start(args);
                Console.ReadLine();
            }
        }
    }
}
